# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=ruby-erubi
pkgver=1.10.0
pkgrel=1
pkgdesc="small ERB implementation"
url="https://github.com/jeremyevans/erubi"
arch="noarch"
license="MIT"
depends="ruby"
checkdepends="ruby-minitest ruby-rake"
options="!check" # requires coveralls
source="$pkgname-$pkgver.tar.gz::https://github.com/jeremyevans/erubi/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/erubi-$pkgver"

build() {
	gem build erubi.gemspec
}

check() {
	rake spec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install \
		--local \
		--install-dir "$gemdir" \
		--bindir "$pkgdir/usr/bin" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		erubi

	rm -r "$gemdir"/cache \
		"$gemdir"/extensions \
		"$gemdir"/doc
}

sha512sums="
adf62511ce9324b4c5f7a95863254c9d95cf40f2107eddad1118ef97d7f534fb74d79b48575ff17209e492811a9a8f87c52fa7a30e4b6ea4e50504cf5572c024  ruby-erubi-1.10.0.tar.gz
"
